package com.why.action;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.why.entity.EUDataGrid;
import com.why.entity.EasyUiTree;
import com.why.entity.Test;
import com.why.service.OrgService;

@Controller
@RequestMapping(value = "/org") 
public class OrgController {

	@Resource
	private OrgService org;
	
	@RequestMapping(value = "/getOrgs.do") 
	public @ResponseBody List<EasyUiTree> indexTree(){
		EasyUiTree en = org.getAllOrgs();
		List<EasyUiTree> l = new ArrayList<EasyUiTree>();
		l.add(en);
	    return l;
	}
	
	@RequestMapping(value = "/getOrgById.do") 
	public void getOrgById(
			@RequestParam("org_id") String org_id){
		org.getOrgById(org_id);
	}
	
	@RequestMapping(value = "/getSubOrgById.do") 
	public void getSubOrgById(
			@RequestParam("org_id") String org_id){
		org.getSubOrgById(org_id);
	}
	
	
	@RequestMapping(value = "/getData.do") 
	public @ResponseBody EUDataGrid getData(
			@RequestParam("org_id") String org_id,
			@RequestParam("start") String start){
		EUDataGrid dg  = org.getIndex_data(org_id,start);
		return dg;
	}
}
